package xyz.xtt.pay.entity;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import xyz.xtt.pay.api.enums.PayOrderBusinessTypeEnum;
import xyz.xtt.pay.api.enums.PayOrderStatusEnum;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tbl_pay_order")
@ApiModel(value = "TblPayOrder对象", description = "支付订单主表")
public class TblPayOrder implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键id")
    @TableId(value = "pay_order_id", type = IdType.AUTO)
    private Long payOrderId;

    @ApiModelProperty(value = "businessOrder表id")
    private Long businessOrderId;

    /**
     * 订单业务类型：
     * @see PayOrderBusinessTypeEnum#getCode()
     */
    @ApiModelProperty(value = "订单业务类型: 1 -> nft资产交易; 2 -> 个人铸造上链")
    private Integer businessType;

    @ApiModelProperty(value = "关联业务id")
    private String businessRefId;

    @ApiModelProperty(value = "通通app用户id")
    private Long appUserId;

    /**
     * 支付状态：
     * @see PayOrderStatusEnum#getCode()
     */
    @ApiModelProperty(value = "支付状态： 0 -> 未支付 1 ->  已支付 2 -> 支付失败 3 -> 支付取消")
    private Integer payStatus;

    @ApiModelProperty(value = "订单金额")
    private java.math.BigDecimal orderMoney;

    @ApiModelProperty(value = "实际支付金额")
    private java.math.BigDecimal payMoney;

    @ApiModelProperty(value = "创建时间")
    private Long createTime;

    @ApiModelProperty(value = "支付成功时间")
    private Long paySuccessTime;

    @ApiModelProperty(value = "最后一次更新时间")
    private Long updateTime;

    @ApiModelProperty(value = "业务附加参数")
    private String businessAttach;

    @ApiModelProperty(value = "支付渠道订单号")
    private String payTradeNo;

    @ApiModelProperty(value = "支付渠道 210:微信支付  220:通通支付 240:宝付支付 250:宝付支付")
    private Integer payMode;

    @ApiModelProperty(value = "支付渠道-子渠道 210001:微信支付 220001:美付宝支付 240001:宝付支付 250001:宝付银行卡支付")
    private Integer payModeSub;

}
